package io.renren.modules.store.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.store.dao.TStoreTimeIntervalDao;
import io.renren.modules.store.entity.TStoreTimeIntervalEntity;
import io.renren.modules.store.service.TStoreTimeIntervalService;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("tStoreTimeIntervalService")
public class TStoreTimeIntervalServiceImpl extends ServiceImpl<TStoreTimeIntervalDao, TStoreTimeIntervalEntity> implements TStoreTimeIntervalService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TStoreTimeIntervalEntity> page = this.page(
                new Query<TStoreTimeIntervalEntity>().getPage(params),
                new QueryWrapper<TStoreTimeIntervalEntity>()
                        .eq(!params.get("sellerId").equals(""),"seller_id",params.get("sellerId"))
                        .eq(params.get("status") != null , "status",params.get("status"))
        );

        return new PageUtils(page);
    }

}